package TransactionImplementation

import (
	"SPC/AbstractTransactions"
	"SPC/Model"
	"SPC/ModelImplementation"
)

type AddCommissionedEmployee struct {
	//继承父类
	AbstractTransactions.AddEmployeeTransaction
	itsSalary         float64
	itsCommissionRate float64
}

func NewAddCommissionedEmployee(empid int, name string, address string, salary float64, commissionRate float64) *AddCommissionedEmployee {
	n := &AddCommissionedEmployee{
		*AbstractTransactions.NewAddEmployeeTransaction(empid, name, address),
		salary,
		commissionRate,
	}
	//将子类的方法传递给父类（基类）
	n.AddEmployeeTransaction.GetClassification = n.GetClassification
	n.AddEmployeeTransaction.GetSchedule = n.GetSchedule
	return n
}

func (a *AddCommissionedEmployee) GetClassification() Model.PaymentClassification {
	return &ModelImplementation.CommissionedClassification{}
}

func (a *AddCommissionedEmployee) GetSchedule() Model.PaymentSchedule {
	return &ModelImplementation.BiweeklySchedule{}
}
